home *** CD-ROM | disk | FTP | other *** search
- BCMD Copyright (c) 1993-1994 Thomas G. Hanlin III
- =-------------------------------------------------=
- The Better Command Utilities, version 2.0
-
-
-
- The Better Command Utilities, or BCMD, is a set of commands
- which provide improved replacements for existing DOS commands
- (like DIR and COPY) and many entirely new commands as well. BCMD
- may be used instead of, or along with, existing DOS commands.
-
- BCMD offers many improvements over the default DOS commands.
- These include multiple file specifications on a single command
- line, exception filespecs, directory colorization, 132-column
- support, test modes, support for file descriptions and other
- goodies. Help is built into each command and will be displayed
- if you use the /? switch.
-
- The BCMD collection is copyrighted. It may be distributed only
- under the following conditions:
-
- All BCMD files must be distributed together as a unit.
- No files may be altered, added, or deleted from this unit.
-
- YOU USE BCMD ENTIRELY AT YOUR OWN RISK. It works for me on the
- computers I've tried it on. I can't guarantee it will do the
- same for you.
-
- BCMD is not free software. If you find this evaluation copy
- suited to your needs, send in your registration. The ORDER.FRM
- file gives complete ordering information.
-
- Table of Contents page 2
-
-
-
- Overview and Legal Info ................................... 1
-
- General Notes ............................................. 3
-
- BCHOICE (batch input) ..................................... 4
- BCOPY (copy file) ......................................... 5
- BDEL (delete file) ........................................ 6
- BDIR (file directory) ..................................... 7
- BEEP (sound effects)....................................... 8
- BMD (make directory) ...................................... 9
- BRD (remove directory) .................................... 9
- BREN (rename file) ....................................... 10
- BTYPE (display file) ..................................... 11
-
- CAL (calendar) ........................................... 11
- CALC (calculator) ........................................ 12
- CAPSLOCK (Caps Lock setting) ............................. 12
- COLOR (set display colors) ............................... 13
-
- DESCRIBE (describe file) ................................. 14
-
- ECHOS (echo w/o CR/LF) ................................... 15
-
- FREE (show disk space) ................................... 15
-
- KEYSPEED (set keyboard speed) ............................ 16
-
- LOCASE (lowercase filter) ................................ 16
- LOCATE (set cursor position) ............................. 17
- LTRIM (left trim filter) ................................. 17
-
- NUMLOCK (Num Lock setting) ............................... 18
-
- ONESPACE (one space filter) .............................. 18
-
- TYME (time and date) ..................................... 19
-
- UNANSI (remove ANSI filter) .............................. 19
- UNCPM (remove Ctrl-Z EOFs) ............................... 20
- UPCASE (uppercase filter) ................................ 21
-
- General Notes page 3
-
-
-
- The BCMD utilities which act as replacements for existing DOS
- commands are given names which start with "B" to differentiate
- them from the corresponding DOS command. These include:
-
- BCHOICE, BCOPY, BDEL, BDIR, BMD, BRD, BREN, BTYPE
-
- These commands act much like the DOS commands they're based on,
- by default. You can customize them with additional capabilities
- using command-line options and/or environment variables.
-
- Like DOS, BCMD will normally display filenames in uppercase. You
- can change this to lowercase for all of the BCMD utilities by
- setting a BCMD environment variable:
-
- SET BCMD=/L
-
- Place that SET line in your AUTOEXEC.BAT file if you'd like to
- install it automatically whenever you start your computer.
-
- If you don't want the status reporting that most BCMD commands
- give you as a matter of course, you can also turn it off with
- the BCMD environment variable, using the /Q (quiet) switch.
-
- Individual BCMD commands will often have their own environment
- variables so you can customize them to your preferences. These
- will be discussed in the documentation for each command.
-
- Some BCMD commands support color. For color support to work, you
- must have an ANSI driver (such as ANSI.SYS) installed. See your
- DOS manual for details on ANSI if BCMD displays odd characters
- instead of color.
-
- BCMD file descriptions are maintained in a format compatible
- with the 4DOS and NDOS command shells.
-
- BCMD disk access remains to be optimized. Some commands in some
- configurations will be noticeably slow on floppy drives.
-
- BCHOICE page 4
-
-
-
- The CHOICE command debuted in MS-DOS 6.0, when Microsoft finally
- noticed that interactive batch files might be handy. It is a
- flexible input command that allows you to specify a list of
- valid responses and a timeout in case no one is present. The
- BCHOICE command works the same way, but for any DOS version.
-
- Syntax:
- BCHOICE {options} {text}
-
- Options:
-
- /C[:]keys keys to accept
- /N no prompt
- /S case sensitive
- /T[:]c,nnnn default answer, seconds to wait for answer
-
- If you do not specify which keys to accept, YN will be assumed.
- You may choose a default answer and the amount of time to wait
- for an answer (0-9999 seconds). The result is returned via the
- DOS error level: 1 for the first key listed, 2 for the second,
- etc; 0 if ^C or Break is pressed; 255 if syntax error.
-
- The text prompt should be enclosed in quotation marks for best
- results. Otherwise, the text may be altered in various ways by
- the command-line parser.
-
- Example:
- BCHOICE /T:N,4 "Shall we play a game "
-
- This example displays:
-
- Shall we play a game [Y,N]?
-
- ...and waits for up to four seconds for an answer, assuming "N"
- if no key is pressed.
-
- BCOPY page 5
-
-
-
- The BCOPY command is similar to the DOS command, COPY. It is a
- pure file-to-file copy command, however. It does not support
- devices or append operations.
-
- Unlike the DOS command it replaces, BCOPY can accept multiple
- source and destination files, can copy hidden, read-only, and
- system files, accepts exception specifications, and allows
- prompting for confirmation before copying or before overwriting
- existing files.
-
- When specifying multiple source or destination files, enclose
- them in parentheses so BCOPY can tell which is which.
-
- Syntax:
- BCOPY {options} [source(s)] [dest(s)] {/E [exception(s)]}
-
- Options:
- /E copy everything EXCEPT for the following files
- /H copy hidden, read-only, and system files too
- /L display filenames in lowercase
- /N don't actually copy anything (for testing BCOPY)
- /P prompt for confirmation before copying each file
- /Q quiet: don't display filenames or summary
- /R prompt before overwriting existing files
- /Y assume YES to all requests for confirmation
-
- The following parameters may be set as defaults for BCOPY by
- setting the BCOPY environment variable: /H /L /P /Q /R /Y
-
- Example:
- BCOPY (A: B:) C:\MISC
-
- The above example copies all files on both A: and B: drives to
- the directory C:\MISC.
-
- Example:
- BCOPY *.* A: /E *.LTR *.TXT
-
- The above example copies all files in the current directory to
- drive A:, except for files that end in .LTR or .TXT.
-
- BDEL page 6
-
-
-
- The BDEL command is similar to the DOS command, DEL (or ERASE).
-
- Unlike the DOS command it replaces, BDEL can accept multiple
- file specs, can delete hidden, read-only, and system files,
- accepts exception specifications, and can recurse through an
- entire directory tree.
-
- Syntax:
- BDEL {options} [file(s)] {/E [exception file(s)]}
-
- Options:
- /E delete everything EXCEPT for the following files
- /H delete hidden, read-only, and system files too
- /L display filenames in lowercase
- /N don't actually delete anything (for testing BDEL)
- /P prompt for confirmation before deleting each file
- /Q quiet: don't display filenames or summary
- /S recurse through subdirectories
- /Y assume YES to all requests for confirmation
-
- The following parameters may be set as defaults for BDEL by
- setting the BDEL environment variable: /H /L /P /Q /Y
-
- Example:
- BDEL A: B: /E *.EXE
-
- The above example deletes all files on both A: and B: drives,
- except for files ending in .EXE.
-
- Example:
- BDEL /H /P *.*
-
- The above example deletes all files in the current directory,
- including hidden, read-only, and system files. It asks for
- confirmation before deleting each file.
-
- Example:
- BDEL /S C:\*.BAK
-
- The above example deletes all files in every directory on the C:
- drive which end in the extension .BAK.
-
- BDIR page 7
-
-
-
- The BDIR command is similar to the DOS command, DIR.
-
- Unlike the DOS command it replaces, BDIR can accept multiple
- file specs, can colorize its listing, supports 132 columns,
- allows descriptions to be tagged onto files, can show file
- attributes, and is highly configurable.
-
- Syntax:
- BDIR {options} {file(s)} {/E [exception file(s)]}
-
- Options:
- /A attributes (any of ADHRS: Arc Dir Hid R/O Sys)
- /B bare list: filenames only, single column
- /D don't show dot directories ("." and "..")
- /E dir of everything EXCEPT for the following files
- /K suppress header (pathname, etc)
- /L display filenames in lowercase
- /M suppress footer (totals, etc)
- /O sorting order (any of DGNS: Date GroupDirs Name Size)
- /P prompt to continue at end of each full screen
- /S recurse through subdirectories
- /T display file attributes
- /U display only summary info
- /W wide list: filenames only, multiple columns
- /X extra wide output (132-column mode)
- /Y display file descriptions
- /Z colorize (defaults may be changed with COLORDIR vbl)
-
- The following parameters may be set as defaults for BDIR by
- setting the BDIR environment variable:
- /A /D /K /L /M /O /P /T /X /Y /Z
-
- Example:
- BDIR /Z /Y /OGN
-
- The above example displays all files in the current directory,
- colorized, with descriptions (if any). Subdirectories are
- grouped before files, and it is sorted in alphabetical order.
-
- The COLORDIR environment variable can be used to change the /Z
- option's colors. You may set colors based on file extensions and
- file attributes (attributes take precedence):
-
- SET COLORDIR=[extlist]:[color] {; [extlist]:[color]} {etc}
-
- An "extlist" is a list of extensions or attributes, separated by
- spaces. Attributes are ARCHIVE, DIRS, SYSTEM, HIDDEN, RDONLY.
- Colors are the same as for the COLOR command, but background
- colors are not allowed.
-
- Example:
- SET COLORDIR=DOC TXT:BLUE;DIRS:BRIGHT GREEN;BAS:RED
-
- The above example makes .DOC and .TXT files blue, directories
- bright green, and .BAS files red.
-
- BEEP page 8
-
-
-
- The BEEP command provides simple sound effects through the PC
- speaker.
-
- Syntax:
- BEEP {frequency duration}
-
- The frequency is specified in Hertz (cycles per second). The
- duration is given in 1/18th seconds. No sound will be generated
- for frequencies below 20, allowing you to use this as a delay
- command as well.
-
- If no parameters are specified, a 440 Hz tone will sound for 2
- eighteenths of a second.
-
- You may specify multiple frequency/duration pairs on the same
- line.
-
- Note Frequency (highest octave)
- ===== =========
- A 3520
- A#,B- 3714
- B 3952
- C 4186
- C#,D- 4434
- D 4698
- D#,E- 4978
- E 5274
- F 5588
- F#,G- 5920
- G 6272
- G#,A- 6644
-
- You can drop down an octave by halving the frequency for a given
- note. A "#" suffix indicates a sharp, and "-" a flat note.
-
- BMCD page 9
-
-
-
- The BMCD command combines the functions of the DOS commands, MD
- (or MKDIR) and CD (or CHDIR): It creates a directory and makes
- it the current default directory. BMCD can accept multiple
- directory specifications.
-
- Syntax:
- BMCD [directory] {directory} {etc}
-
- Example:
- BMCD A:\GAME B:\DOC
-
- The above example creates the subdirectories A:\GAME and B:\DOC,
- and makes them the default subdirectories for drives A: and B:,
- respectively.
-
-
-
-
- The BMD command is similar to the DOS command, MD (or MKDIR).
-
- Unlike the DOS command it replaces, BMD can accept multiple
- directory specifications.
-
- Syntax:
- BMD [directory] {directory} {etc}
-
- Example:
- BMD ONE TWO
-
- The above example creates the subdirectories ONE and TWO.
-
-
-
-
- BRD
-
-
-
- The BRD command is similar to the DOS command, RD (or RMDIR).
-
- Unlike the DOS command it replaces, BRD can accept multiple
- directory specifications.
-
- Syntax:
- BRD [directory] {directory} {etc}
-
- Example:
- BRD ONE TWO
-
- The above example removes the subdirectories ONE and TWO.
-
- BREN page 10
-
-
-
- The BREN command is similar to the DOS command, REN (or RENAME).
-
- Unlike the DOS command it replaces, BREN can accept multiple
- source files, accepts full paths for both source and destination
- filespecs, allows renaming from one drive to another, can rename
- hidden, read-only, and system files, allows overwriting existing
- files, accepts exception specifications, and allows prompting
- for confirmation before renaming or before overwriting existing
- files.
-
- When specifying multiple source files, the source files must be
- enclosed in parentheses, and the destination must be a directory
- rather than a filespec.
-
- By default, the rename will fail if the destination file already
- exists. You can override this with /R (add /Y if you don't want
- to confirm each overwrite yourself).
-
- Syntax:
- BREN {options} [source(s)] [destination] {/E [exception(s)]}
-
- Options:
- /E rename everything EXCEPT for the following files
- /H rename hidden, read-only, and system files too
- /L display filenames in lowercase
- /N don't actually rename anything (for testing BREN)
- /P prompt for confirmation before renaming each file
- /Q quiet: don't display filenames or summary
- /R prompt before overwriting existing files
- /Y assume YES to all requests for confirmation
-
- The following parameters may be set as defaults for BREN by
- setting the BREN environment variable: /H /L /P /Q /R /Y
-
- Example:
- BREN (A: B:) C:\MISC /E *.TXT
-
- The above example moves all files on both A: and B: drives to
- the directory C:\MISC, except for files ending in .TXT. The
- rename is not done for files that already exist in C:\MISC.
-
- Example:
- BREN /R /Y *.BAK \BACKUP
-
- The above example moves all .BAK files from the current
- directory to the \BACKUP directory, overwriting any existing
- files by the same name.
-
- BTYPE page 11
-
-
-
- The BTYPE command is similar to the DOS command, TYPE.
-
- Unlike the DOS command it replaces, BTYPE provides pagination.
-
- Syntax:
- BTYPE {options} [file(s)]
-
- Options:
- /P prompt to continue at end of each full screen
-
-
-
-
- CAL
-
-
-
- The CAL command displays a calendar. If no parameters are given,
- the calendar is for the current month and year. Month and/or
- year values can be specified as well.
-
- Syntax:
- CAL {month} {year}
-
- If the month is specified, it must be spelled out. It may be
- abbreviated to as few as three characters (JAN, FEB, etc).
-
- You may enter either two digits or four digits for the year. If
- two digits are used, the 21st century will be assumed for 0-9,
- or the 20th century otherwise. The calendar program accepts a
- year range of 1900-2078.
-
- CALC page 12
-
-
-
- The CALC command is a calculator.
-
- Syntax:
- CALC expression
-
- Expressions may use the following operators:
- + add
- - subtract
- * multiply
- / divide
- ^ raise to a power
- ** raise to a power (alternate form)
-
- Parentheses may be used to override the default algebraic
- precedence, which is: negation, raise to power, multiply and
- divide, add and subtract.
-
- Example:
- CALC 19.95 * 1.05 + 3
-
-
-
-
- CAPSLOCK
-
-
-
- The CAPSLOCK command lets you get or set the Caps Lock state.
-
- Syntax:
- CAPSLOCK {ON or OFF}
-
- The current Caps Lock state is displayed if you do not give a
- parameter. Otherwise, Caps Lock is set as you request.
-
- COLOR page 13
-
-
-
- The COLOR command allows you to set the display colors. An ANSI
- driver must be installed for it to function.
-
- Syntax:
- COLOR {BRIGHT} {BLINKING} foregroundcolor {ON backgroundcolor}
-
- Colors:
- BLACK BLUE GREEN RED MAGENTA CYAN YELLOW WHITE
-
- Color parameters may be shortened to as little as three
- characters each. BROWN may be used instead of YELLOW (on most
- displays, the "normal" color appears brown, and the "bright"
- version of the same color appears yellow).
-
- Example:
- COLOR BRIGHT WHITE ON RED
-
- The above example sets the foreground color to bright white, and
- the background color to red. A shorter version of the same thing
- might look like this:
- COLOR BRI WHI ON RED
-
- DESCRIBE page 14
-
-
-
- The DESCRIBE command allows you to attach a description to a
- file or subdirectory name. This description will be shown when
- you use the BDIR directory command. It is also compatible with
- the 4DOS and NDOS command shells, and will be shown by the DIR
- command provided with those shells.
-
- Descriptions may be up to 120 characters, although the part of
- the description that is shown depends on the BDIR parameters. It
- is 31-37 characters in 80-column mode, depending on whether file
- attributes are also being shown. In 132-column mode, up to 81
- characters of the file description are displayed.
-
- Descriptions are kept in a hidden file named DESCRIPT.ION. They
- are automatically maintained by BCMD file utilities (BDEL, BREN,
- BCOPY, etc) and other software that is aware of descriptions
- (4DOS, NDOS, etc). Descriptions may not be properly updated if
- you do file handling with other software.
-
- Syntax:
- DESCRIBE {options} [file(s)] {/E [except file(s)]} {"desc"}
-
- Options:
- /E describe everything EXCEPT for the following files
- /L display filenames in lowercase
- /Q quiet: don't display filenames or summary
-
- The description may be included on the DESCRIBE command line, or
- you may leave it off-- in which case, you will be prompted for a
- description for each of the selected files.
-
- Example:
- DESCRIBE BCMD.DOC "Documentation for BCMD utilities"
-
- In the above example, the file BCMD.DOC will be tagged with the
- description "Documentation for BCMD utilities" (without the
- quotation marks).
-
- Example:
- DESCRIBE *.DOC
-
- In the above example, the DESCRIBE command will ask you for a
- description for each of the .DOC files in the current directory.
-
- ECHOS page 15
-
-
-
- The ECHOS command is for use in batch files. It displays text
- like the ECHO command, but without moving to the next line. This
- makes it easy to display multiple items on the same line. In
- order for this to be effective, the batch ECHO state must be
- turned off so that the batch commands aren't shown.
-
- Syntax:
- ECHOS message
-
- Example:
- ECHO OFF
- ECHOS This is
- ECHOS a test
-
- This example displays:
-
- This is a test
-
-
-
-
- FREE
-
-
-
- The FREE command shows the amount of disk space available and
- the amount used.
-
- Syntax:
- FREE {drive{:}} {drive{:}} {etc}
-
- If no drive specs are given, stats for the current drive will be
- shown. One or more drives may be specified. A colon (":") may,
- optionally, be placed after each drive letter.
-
- Example:
- FREE C: D:
-
- KEYSPEED page 16
-
-
-
- The KEYSPEED command sets the keyboard repeat rate. It will not
- work on 8088 PCs.
-
- The default keyboard repeat rate is quite sluggish, and you'll
- be amazed at how much more responsive your machine is with
- faster settings! You can also reduce responsiveness in order to
- make the keyboard more manageable for young children, etc.
-
- Syntax:
- KEYSPEED delay repeatrate
-
- The starting delay may be 0-3, and is 2 by default. The repeat
- rate may be 0-31, and is 10 by default. In both cases, settings
- of zero are fastest.
-
- Example:
- KEYSPEED 0 0
-
- The above example sets the keyboard repeat as fast as possible.
-
- Example:
- KEYSPEED 2 10
-
- The above example restores the default keyboard repeat rate.
-
-
-
-
-
- LOCASE
-
-
-
- The LOCASE filter converts text to lowercase. It works only with
- ASCII characters, so it does not fully support international
- character sets.
-
- Filters are used in conjunction with redirection or piping. They
- accept an incoming stream of text, modify it, and pass it on.
-
- Example:
- LOCASE <BCMD.NEW
-
- The above example converts the BCMD.NEW file to lowercase and
- displays the results.
-
- Example:
- BDIR | LOCASE
-
- The above example converts the output of the BDIR command to
- lowercase and displays the results.
-
- LOCATE page 17
-
-
-
- The LOCATE command sets the cursor position. It is intended for
- use primarily in designing displays for batch files. An ANSI
- driver, such as ANSI.SYS, must be installed.
-
- Syntax:
- LOCATE row column
-
- Cursor coordinates are based on (1,1), which is the upper left
- corner of the display. A typical display has rows 1-25 and
- columns 1-80.
-
- Example:
- LOCATE 5 1
-
- The above example positions the cursor on the first column of
- the fifth row of the screen.
-
-
-
-
- LTRIM
-
-
-
- The LTRIM filter removes blanks from the left side of each line
- of text. Blanks are construed as space or tab characters.
-
- Filters are used in conjunction with redirection or piping. They
- accept an incoming stream of text, modify it, and pass it on.
-
- Example:
- LTRIM <BCMD.NEW
-
- The above example trims blanks from the left side of each line
- of the BCMD.NEW file and displays the results.
-
- Example:
- BDIR | LTRIM
-
- The above example trims blanks from the left side of each line
- of the output of the BDIR command and displays the results.
-
- NUMLOCK page 18
-
-
-
- The NUMLOCK command lets you get or set the Num Lock state.
-
- Syntax:
- NUMLOCK {ON or OFF}
-
- The current Num Lock state is displayed if you do not give a
- parameter. Otherwise, Num Lock is set as you request.
-
-
-
-
- ONESPACE
-
-
-
- The ONESPACE filter converts multiple spaces in a line of text
- to single spaces.
-
- Filters are used in conjunction with redirection or piping. They
- accept an incoming stream of text, modify it, and pass it on.
-
- Example:
- ONESPACE <BCMD.NEW
-
- The above example takes each line of the file BCMD.NEW, converts
- sequences of two or more spaces to one space, and displays the
- results.
-
- Example:
- BDIR | ONESPACE
-
- The above example takes the output of the BDIR command, converts
- sequences of two or more spaces in a line to a single space, and
- displays the results.
-
- TYME page 19
-
-
-
- The TYME command displays the current time and date in a readily
- understandable format.
-
- Syntax:
- TYME
-
- The output of TYME looks like this:
-
- It is 11:11 am on Saturday, August 14, 1993.
-
-
-
-
- UNANSI
-
-
-
- The UNANSI filter removes ANSI sequences from text. This can be
- useful in cleaning up text that was captured from a BBS and
- removing colors from BDIR output if color is on by default, and
- so on.
-
- Filters are used in conjunction with redirection or piping. They
- accept an incoming stream of text, modify it, and pass it on.
-
- Example:
- UNANSI <CAPTURE.BBS
-
- The above example removes all ANSI sequences from the file
- CAPTURE.BBS and displays the results.
-
- Example:
- BDIR | UNANSI
-
- The above example removes ANSI sequences from the output of the
- BDIR command and displays the results.
-
- UNCPM page 20
-
-
-
- The UNCPM command removes control-Z characters from the end of
- files. This is normally used only on text files.
-
- The old CP/M operating system did not keep track of the exact
- size of files, so the end of text files was normally marked with
- a control-Z character. This carried over into the early days of
- MS-DOS, which was designed to make the transition from CP/M as
- easy as possible. Unfortunately, some programs still use Ctrl-Z
- as an end-of-file marker, even though MS-DOS keeps track of
- exact file sizes. This can lead to trouble.
-
- If there happens to be a Ctrl-Z embedded in a file which is
- handled by a CP/M-style program, the file will be truncated at
- the Ctrl-Z. This can quite readily occur if an editor adds a
- Ctrl-Z to the end of a file which is subsequently appended to by
- a program which doesn't expect CP/M terminators, for example.
- The UNCPM utility helps avoid such errors.
-
- Syntax:
- UNCPM {options} [file(s)] {/E [exception file(s)]}
-
- Options:
- /E UnCPM everything EXCEPT for the following files
- /H UnCPM hidden, read-only, and system files too
- /L display filenames in lowercase
- /N don't actually UnCPM anything (for testing UNCPM)
- /P prompt for confirmation before UnCPMing each file
- /Q quiet: don't display filenames or summary
- /S recurse through subdirectories
- /Y assume YES to all requests for confirmation
-
- Example:
- UNCPM *.TXT *.DOC
-
- The above example removes Ctrl-Z terminators from all files
- ending in .TXT and .DOC in the current directory.
-
- UPCASE page 21
-
-
-
- The UPCASE filter converts text to uppercase. It works only with
- ASCII characters, so it does not fully support international
- character sets.
-
- Filters are used in conjunction with redirection or piping. They
- accept an incoming stream of text, modify it, and pass it on.
-
- Example:
- UPCASE <BCMD.NEW
-
- The above example converts the BCMD.NEW file to uppercase and
- displays the results.
-
- Example:
- BDIR | UPCASE
-
- The above example converts the output of the BDIR command to
- uppercase and displays the results.
-
-